$NG.AllReady(function (page, { useAction, useBeforeClick, useValuesChange, useClick, useUpdateRow, subscribe, useUpdateRows }) {
    const mstform = $NG.getCmpApi("p_form_jlhjysbspjqd_m")
    const dgrid1 = $NG.getCmpApi("p_form_jlhjysbspjqd_d1")
    const getHeadValue = (str) => mstform.getItem(str).getValue()

    useUpdateRows(() => {
        const rows = dgrid1.getRows()
        rows.forEach(item => {
            item.u_hj = (Number(item.u_fghfx) || 0) + (Number(item.u_fspl) || 0) + (Number(item.u_yxfw) || 0) + (Number(item.u_yxcd) || 0) + (Number(item.u_xgfgzcd) || 0)
            item.u_hj1 = (Number(item.u_nxhl) || 0) + (Number(item.u_kjycd) || 0)

            // 检查
            let lock = false
            const keys = ["u_fghfx", "u_yxfw", "u_yxcd", "u_xgfgzcd", "u_nxhl", "u_kjycd",]
            keys.forEach(el => {
                if (!lock) {
                    if ((Number(item[el]) || 0) == 5) {
                        lock = true
                    }
                    if (item.u_zjpjtj) {
                        lock = true
                    }
                    item.u_sfwzyhj =  lock?'01':'02'
                }

            })
        })
        dgrid1.refreshView()
    }, "p_form_jlhjysbspjqd_d1")
})